<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ include file="/WEB-INF/pages/comm/comm.jsp"%>

<!-- content begin -->
<div class="container">
    <div class="row">

        <div class="col-xs-12  col-sm-12 sub-content-body-right">
            <div class="div-bg">
                <div class="sub-content-header"><span class="sub-content-title">您正在订阅以下视频：</span></div>
                <div class="clearfix"></div>
                <div class="acc-seperate"></div>
                <div class="sub-content-body">

                    <div class="order-yd">
                        <form>
                            <div class="search-result-item clearfix">
                                <div class="circle-list-l">
                                    <div class="circle-list-logo"><a href="${hyrt}/video/vdetail?id=${video.id}"><img src="${video.videoThumbnailUrl}"></div>
                                    <div class="play-btn1"><img src="${hyrt}/static/images/play-btn.png" alt="" /></div></a>
                                </div>
                                <div class="circle-list-r">
                                    <div class="circle-list-title"> ${video.title}</div>
                                    <div class="search-result-cell-container"> <span class="display-block search-result-cell">${user.name}</span>
                                    </div><div class="clearfix"></div>
                                    <div class="pay-money"> 实付金额：<span>¥ ${video.price}</span></div>
                                    <div class="pay-fangfa">
                                        <input type="radio"><img src="${hyrt}/static/images/pay.jpg" />
                                    </div>

                                </div>
                                <div class="clearfix"></div>
                                <div class="search-result-seperate"></div>
                                <div class="search-result-summary info-list-small">
                                    <p class="text-center">
                                        <a href="javascript:void(0)" class="btn btn-public" onclick="tjdd()">提交订单</a>
                                        <a href="javascript:history.go(-1);" class="btn btn-public" >返回</a>
                                    </p>
                                </div>
                            </div>
                        </form>
                    </div>

                    <div class="clearfix"></div>

                </div>
            </div>
        </div>
    </div>
</div>
<script>
    function  tjdd(){
        var flag=false;
        var data={
            userId:'${user.userId}',
            payCount:'${video.price}',
            sourceId:'${param.sourceId}',
            videoId:'${video.id}'
        };
        if (flag) {
            return false;
        }
        flag=true;
        var url="${hyrt}/orderform/addorupdate"
        $.ajax({
            type: 'POST',
            url: url,
            data: data,
            dataType: "json",
            success: function(data){
                layer.msg(data.msg)
                flag=false;
                if(data.code==200)
                {
                    window.location.href="${hyrt}/pay/toPay?oid="+data.oid;

                }

            }
        });
    }
</script>


</body>
</html>
